﻿using SWBetongXaydung.BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations.Schema;

namespace SWBetongXaydung.DAL
{
    public partial class HanhTrinh
    {
        [NotMapped]
        public string DienGiai
        {
            get
            {
                var tramCap = TramCapBLL.GetTramCap(IDTramCap);
                if (tramCap != null)
                {
                    if (SoPhieu == -2)
                        return "Huế <-> Tứ Hạ";
                    if (SoPhieu != -1)
                        return tramCap.TenTramCap + " -> " + NoiDen;
                    else
                        return NoiDen;
                }
                else
                    throw new Exception("Trạm cấp không tồn tại");

            }
        }
    }
}
